package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorBlockExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.range(1, 3);

        // 阻塞等待数据流的完成，并获取最终结果
        Integer result = source.reduce((x, y) -> x + y).block();

        System.out.println("Sum: " + result); // 输出: Sum: 6
    }
}
